package cn.rxyb.core.io.file;

import java.io.File;
import java.io.Serializable;
import java.nio.charset.Charset;

/**
 * @author YJH
 * @version 1.0
 * @description 文件的扩展包
 * @date 2020/6/28 17:10
 */
public abstract class FileWrapper implements Serializable {

    private static final long serialVersionUID = 332893702359625890L;

    /**
     * 文件流操作
     */
    protected final File file;

    protected Charset charset;

    public FileWrapper(File file) {
        this.file = file;
    }

    public FileWrapper(File file, Charset charset) {
        this.file = file;
        this.charset = charset;
    }

    public FileWrapper(String filePath) {
        this.file = new File(filePath);
    }

    public FileWrapper(String filePath, Charset charset) {
        this.charset = charset;
        this.file = new File(filePath);
    }


    public File getFile() {
        return file;
    }

    public Charset getCharset() {
        return charset;
    }
}
